<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../head.jsp"%>
<html>
<head>
<link rel="stylesheet" href="<%=webBackPath %>css/common.css" type="text/css"/>
<link rel="stylesheet" href="<%=webBackPath %>css/turnPage.css" type="text/css"/>
<script type="text/javascript" src="<%=webBackPath %>js/calendar.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/prototype-1.6.0.3.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/json.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/lib/public.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/lib/md5.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/lib/turnpage.js"></script>
<script language='javascript'>
var xmlHttpOnclic = null;
var mbPageCount = 0;
function turnPage(pageCount) {
	mbPageCount = pageCount;
	var url = "accInfo.pk?updateFlag=getAccInfoFlow" + "&rowNum=" + pageCount;
	if (window.ActiveXObject) {
		xmlHttpOnclic = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.xmlHttpOnclicRequest) {
		xmlHttpOnclic = new xmlHttpOnclicRequest();
	}
	
	xmlHttpOnclic.onreadystatechange = showGift;
	xmlHttpOnclic.open("GET", url, true);
	xmlHttpOnclic.send(null);
}

function showGift() {
	if (xmlHttpOnclic.readyState == 4 || xmlHttpOnclic.readyState == "complete") {
		var goodsArray = JSON.parse(xmlHttpOnclic.responseText);
		var showMsg = "";
		if (goodsArray == "" ||goodsArray.length == 1 && goodsArray[0] == null) {
			alertPP("流水不存在");
			return;
		}
		var totalRows = 0;
		cleanTableBody("showList");
		
		for (var i=0;i<goodsArray.length;i++) {

			var goodDto = goodsArray[i];
			// 总条数
			totalRows = goodDto.TOTALROWNUM;
			addRow("showList", i, goodDto);
		}
		
		var turnPageShow = document.getElementById('turnPageDiv');
		turnPageShow.innerHTML = getTurnPageString(mbPageCount,10,totalRows);
		showDiv('turnPageDiv');
	}
}
function addRow(showListA,rowIndex,goodDto)
{	var tbody  = document.getElementById(showListA);
	
	var row = document.createElement("TR");
	var classNameStr = rowIndex%2==0?"bg1":"bg2";
	row.className = rowIndex%2==0?"bg1":"bg2";
	row.align = "center";
	row.onmouseover = function(){this.className = "result_over";}
	row.onmouseout = function(){this.className = classNameStr;}
				
	var cell = document.createElement("TD");
	cell.align = "center";
	cell.innerHTML = goodDto.FLOWNO;
	row.appendChild(cell);

	cell = document.createElement("TD");
	cell.align = "center";	
	cell.innerHTML = goodDto.USERNO;
	row.appendChild(cell);
	

	cell = document.createElement("TD");
	cell.align = "center";	
	cell.innerHTML = comma(goodDto.XFJF);
	row.appendChild(cell);
	
	cell = document.createElement("TD");
	cell.align = "center";	
	cell.innerHTML = goodDto.REMARKS;
	row.appendChild(cell);
	
	cell = document.createElement("TD");
	cell.align = "center";	
	var iStt = goodDto.EX1;
	var showMsg = "";
	// 0：处理中，1  成功 2，申请取款，3 已经打款，4 返回取款申请
	if (iStt == 0) {
		showMsg = "处理中";
	}else if (iStt == 1) {
		showMsg = "成功";
	}else if (iStt == 2) {
		showMsg = "申请取款";
	}else if (iStt == 3) {
		showMsg = "已经打款";
	}else if (iStt == 4) {
		showMsg = "返回取款申请";
	}
	showMsg = "<bbsh:BBSH name='" + showMsg + "'/>";
	cell.innerHTML = showMsg;
	row.appendChild(cell);
	
	tbody.appendChild(row);
}

</script>
</head>
<body onload="turnPage(1);">

<div id="man_zone">
  <table width="80%" border="1" align="center"  cellpadding="3" cellspacing="1">
	<tr class="list_tilte_table">
      <td align="center"><bbsh:BBSH name="流水号"/></td>
      <td align="center"><bbsh:BBSH name="用户编号"/></td>
      <td align="center"><bbsh:BBSH name="金额"/></td>
      <td align="center"><bbsh:BBSH name="备注"/></td>
      <td align="center"><bbsh:BBSH name="操作类型"/></td>
    </tr>
	<tbody id="showList">
	</tbody>
  </table>
  <div class="page_size" id="turnPageDiv" align="center" >
  </div>
</div>
</body>
</html>
